/*
 * @Author: yangzonglong
 * @Date: 2021-05-07 11:40:21
 * @version: v1.0.0
 * @Descripttion: 
 * @LastEditors: yangzonglong
 * @LastEditTime: 2021-05-07 13:10:09
 * @Auditor: 
 */
import { AUDIT_HISTORY_STATUS } from './../../configs';

export const columns = [
  {
    dataIndex: 'createdAt',
    format: 'time',
    ellipsis: true,
    tooltip: true,
    width: 150
  },
  {
    dataIndex: localStorage.i18nextLng === 'en' ? 'assignEmployeeNameUS' : 'assignUserName',
    title: window.$app.t('assignUserName'),
    ellipsis: true,
    tooltip: true,
    width: 100
  },
  {
    dataIndex: 'taskName',
    ellipsis: true,
    tooltip: true,
    width: 120
  },
  {
    dataIndex: 'action',
    render: (status: string, record: any) =>
      record.actionName ? (localStorage.i18nextLng === 'en' ? (record.actionNameEn || record.actionName) : record.actionName) : AUDIT_HISTORY_STATUS[status],
    width: 120
  },
  {
    dataIndex: 'transferToUserName',
    title: window.$app.t('forwardTo'),
    tooltip: true,
    ellipsis: true,
    render: (_: unknown, record: any) => `${record.transferToEmployeeCode || ''}-${record.transferToUserName || ''}`,
    width: 120
  },
  {
    dataIndex: 'comment',
    title: window.$app.t('auditComment'),
    tooltip: true,
    ellipsis: true,
    render: (comment: string) => comment?.replace(/(\r\n|\n|\r)/gm, '<br />'),
    width: 240
  },
  {
    dataIndex: 'fileList',
    title: window.$app.t('file'),
    ellipsis: true,
    width: 140
  }
];


export const forecastColumns = [
  {
    dataIndex: localStorage.i18nextLng === 'en' ? 'assignEmployeeNameUS' : 'assignUserName',
    title: window.$app.t('assignUserName'),
    ellipsis: true,
    tooltip: true,
    width: 100
  },
  {
    dataIndex: 'taskName',
    ellipsis: true,
    tooltip: true,
    width: 120
  },
  {
    dataIndex: 'action',
    render: (status: string) => AUDIT_HISTORY_STATUS[status],
    width: 120
  },
];
